<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../js/vue.js"></script>
    <title>prop的使用</title>
</head>
<body>

   <div id="root">
    <zjut-student v-bind="student"></zjut-student>
   </div> 


<script>
  let ZjutStudent = Vue.extend({
    template:`
    <div>
    <h1>学生信息</h1>
    <ul>
    <li>姓名:{{name}}</li>
    <li>年龄:{{age}}</li>
    <li>性别:{{sex}}</li>
    </ul> 
</div>
    `,
    props:['student']
  })

  let vm = new Vue({
    el:'#root',
    data: {
       student:{name:'张三',age:18,sex:'男'}
    },
    components:{
        'zjut-student':ZjutStudent
    }
  });
</script>    
</body>

</html>